using System;
using Blazing.BusinessObjects.Cms;
using Blazing.BusinessObjects;
using Blazing.BusinessObjects.Tagging;
using Blazing.BusinessObjects.Widgets;
using Blazing.BusinessObjects.Locations;

namespace BusinessObjectTests
{
    public partial class BusinessObjectFactory
    {
        public static ImageType CreateAndFillImageType()
        {
            ImageType retval = new ImageType();
            retval.Name = "Default Image Type";
            retval.Path = "/DefaultImages/";
            retval.IsHero = true;
            retval.Width = 500;
            retval.Height = 500;
            return retval;
        }

        public static Image CreateAndFillImage()
        {
            Image retval = new Image();
            retval.AlternateText = "Alt desc";
            retval.Description = "New image description";
            retval.Name = "New Image.jpg";

            return retval;
        }

        public static Contentpage CreateAndFillContentPage()
        {
            Contentpage retval = new Contentpage();
            retval.Content = "Some Content";
            retval.Comments = "Some Comments";
            retval.IsActive = true;
            retval.IsHttps = false;
            retval.Name = "test page";
            retval.PageTitle = "Page title";
            retval.PageType = new PageType();
            retval.PageType.ID = 1;
            retval.Url = "/url/";
            return retval;
        }

        public static FeedbackItem CreateAndFillFeedbackItem()
        {
            FeedbackItem retval = new FeedbackItem()
            {
                Name = "Re: Your cool item",
                Content = "Blah blah",
                IsApproved = true,
                UserEmail = "blah@blah.com",
                UserName = "Steve",
                UserUrl = "http://myblog.com",
                UserRating = 5
            };
            return retval;
        }

        public static Theme CreateAndFillTheme()
        {
            Theme retval = new Theme();
            retval.Description = "Some Content";
            retval.Name = "Some Comments";
            retval.Path = "Default";
            return retval;
        }
        public static Masterpage CreateAndFillMasterPage()
        {
            Masterpage retval = new Masterpage();
            retval.Description = "Some Content";
            retval.Name = "Some Comments";
            retval.Path = "Test";
            return retval;
        }
        public static PageType CreateAndFillPageType()
        {
            PageType retval = new PageType();
            retval.Description = "Some Content";
            retval.IsCmsPage = true;
            retval.Name = "Test";
            return retval;
        }

        public static Site CreateAndFillSite()
        {
            Site retval = new Site();
            retval.Name = "Default Site";
            retval.Url = "www.default.com";
            retval.IsLoginRequired = false;
            return retval;
        }

        public static Setting CreateAndFillSetting()
        {
            Setting retval = new Setting();
            retval.Description = "Test setting";
            retval.Name = "TestSetting";
            retval.Value = "Yes!";
            return retval;
        }

        public static StatisticOperatingSystem CreateAndFillStatisticOperatingSystem()
        {
            StatisticOperatingSystem retval = new StatisticOperatingSystem();
            retval.Name = "WindowsXP";
            return retval;
        }

        public static StatisticReferrer CreateAndFillReferrer()
        {
            StatisticReferrer retval = new StatisticReferrer();
            retval.Url = "http://www.google.com.au";
            return retval;
        }

        public static StatisticSession CreateAndFillSession()
        {
            StatisticSession retval = new StatisticSession();
            retval.IpAddress = "127.0.0.1";
            retval.SessionKey = Guid.NewGuid().ToString();
            return retval;
        }

        public static StatisticUseragent CreateAndFillUseragent()
        {
            StatisticUseragent retval = new StatisticUseragent();
            retval.Name = "Mozilla/5.0 (compatible; http://www.bedhound.com);";
            return retval;
        }

        public static StatisticVisitor CreateAndFillVisitor()
        {
            StatisticVisitor retval = new StatisticVisitor();
            retval.Guid = Guid.NewGuid();
            return retval;
        }

        public static StatisticLog CreateAndFillStatisticLog()
        {
            StatisticLog retval = new StatisticLog();
            return retval;
        }

        public static MenuType CreateAndFillMenuType()
        {
            MenuType retval = new MenuType();
            retval.Description = "Desc";
            retval.Name = "Main Menu Type";
            return retval;
        }

        public static Menu CreateAndFillMenu()
        {
            Menu retval = new Menu();
            retval.Description = "Desc";
            retval.Name = "Main Menu";
            return retval;
        }

        public static MenuItem CreateAndFillMenuItem()
        {
            MenuItem retval = new MenuItem();
            retval.Label = "Item 1";
            retval.SortOrder = 1;
            retval.Title = "Click this link";
            return retval;
        }

        public static Location CreateAndFillLocation()
        {
            Location retval = new Location();
            retval.Abbr = "AUS";
            retval.Namelong = "Australia";
            retval.Nameshort = "Australia";

            return retval;
        }

        public static AddressType CreateAndFillAddressType()
        {
            AddressType retval = new AddressType();
            retval.Name = "Postal";
            return retval;
        }

        public static Country CreateAndFillCountry()
        {
            Country retval = new Country();
            retval.Name = "Australia";
            retval.Countrycode = "AUS";
            return retval;
        }

        public static Currency CreateAndFillCurrency()
        {
            Currency retval = new Currency();
            retval.Name = "Australian Dollar";
            retval.Code = "AUD";
            return retval;
        }

        public static State CreateAndFillStates()
        {
            State retval = new State();
            retval.Name = "Queensland";
            retval.Abbr = "QLD";
            return retval;
        }

        public static Address CreateAndFillAddress()
        {
            Address retval = new Address();
            retval.Address1 = "L2";
            retval.Address2 = "1 Cavil Ave";
            retval.Address3 = "c/o person";
            retval.Postcode = "4215";
            retval.Suburb = "Surfers Paradise";
            return retval;
        }

        public static Tag CreateAndFillTag()
        {
            Tag retval = new Tag();
            retval.Name = "Tag 1";
            retval.Slug = "tag1";
            return retval;
        }

        public static Taxonomy CreateAndFillTaxonomy()
        {
            Taxonomy retval = new Taxonomy();
            retval.Name = "Taxonomy 1";
            retval.Slug = "taxonomy1";
            //retval.TaxonomyTypeId = 0;            
            return retval;
        }

        public static TaxonomyType CreateAndFillTaxonomyType()
        {
            TaxonomyType retval = new TaxonomyType();
            retval.Name = "Internal";
            retval.Description = "Internal Taxonomy Type";
            return retval;
        }


        public static TaxonomyTag CreateAndFillTaxonomyTag()
        {
            TaxonomyTag retval = new TaxonomyTag();
            retval.Tag = new Tag();
            retval.Taxonomy = new Taxonomy();
            retval.Count = 1;
            retval.Description = "Taxonomy Tag Description";
            return retval;
        }

        public static Widget CreateAndFillWidget()
        {
            Widget retval = new Widget();
            retval.Name = "BookNowLink";
            retval.Path = "~/usercontrols/booknowlink.ascx";
            return retval;
        }

        public static WidgetRegion CreateAndFillWidgetRegion()
        {
            WidgetRegion retval = new WidgetRegion();
            retval.Name = "Left";
            return retval;
        }
    }
}
